/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package homework.demo04;

/**
 *
 * @author wb4987
 */
public class WorkEmail {
    public static void main(String[] args) {
        int String = 0;
        String mobile = "fyx@163.com";
        boolean flag = true;
        if (mobile.length()!=255) {
            flag = false;
        }
        if (!(mobile.startsWith("fyx"))) {
            flag = false;
        }
       
        String numstr1 = "0123456789fyx@163.com";
        for (int i = 0; i < mobile.length(); i++) {
            char c = mobile.charAt(i);
            int temp = numstr1.indexOf(c);
            if (temp<0) {
                flag = false;
                break;
            }
        }
        if (flag) {
            System.out.println("Email格式正确");
        }else{
            System.out.println("Email格式不正确");
        }
    }

}
